package insertpackage;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import javabean.Project;

public class Insertpro extends Insert{
	public void insertDB(Project pro) {
        Connection conn = null;
        PreparedStatement pstmt = null;
        
        try {
        	conn = getConnection();

            pstmt = conn.prepareStatement("insert into PROJECT values (?,?,?,?,?,?,?,?,?,?,?,?,?)");
            pstmt.setString(1, null);
            pstmt.setString(2, pro.getProNAME());
            pstmt.setString(3, pro.getProESTART());
            pstmt.setString(4, pro.getProEEND());
            pstmt.setInt(5, pro.getProECOST());
            pstmt.setString(6, pro.getProTEXT());
            pstmt.setString(7, pro.getProENVIR());
            pstmt.setString(8, pro.getProMETHOD());
            pstmt.setString(9, pro.getProASTART());
            pstmt.setString(10, pro.getProAEND());
            pstmt.setInt(11, pro.getProACOST());
            pstmt.setString(12, pro.getEmpID());
            pstmt.setInt(13, pro.getProCOUNT());
            
            pstmt.executeUpdate();
        } catch(SQLException ex) {
            
        } finally {
            if (pstmt != null) try { pstmt.close(); } catch(SQLException ex) {}
            if (conn != null) try { conn.close(); } catch(SQLException ex) {}
        }
    }
}